using Tiwo.Design.ItemRenderers;
using Tiwo.Elements;

namespace Tiwo.Design
{
    public class SchemeEditable
    {
        public ISchemeRenderer Renderer { get; private set; }

        public SchemeEditable(ISchemeRenderer site, Environment environment)
        {
            Renderer = site;
            Environment = environment;
        }

        public Scheme Scheme { get; set; }
        public Environment Environment { get; set; }

        public void CreateNewInput()
        {
            var point = new InputFlowPoint();
            var renderer = new InputRenderer(point)
            {
                Location = Renderer.LastClickLocation,
                ActionProvider = new InputOperations(point, Environment)
            };

            Scheme.AddInput(point);
            Renderer.Add(renderer);
        }
    }
}